package com.seckill.annotation;

import com.seckill.PhoneValid;
import com.seckill.enums.ResultEnum;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
@Constraint(validatedBy = {PhoneValid.class})
public @interface IsPhone {
    boolean required() default false;
    String message() default "手机号不符合规则";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
